package LeetCode.month04.day99;

/**
 * @author 16778
 * @date 2025/11/9 8:10
 * @description
 */
public class No2169 {
    public int countOperations(int num1, int num2) {
        if(num2>num1){
            int temp = num2;
            num2 = num1;
            num1 = temp;
        }
        int step = 0;
        while(num1!=0&&num2!=0){
            if(num1%num2==0){
                step+=num1/num2;
                return step;
            }
            step += num1 /num2;
            num1 = num1%num2;
            int temp = num2;
            num2 = num1;
            num1 = temp;
        }
        return step;
    }
}
